<?php
/**
 * 网站上下架记录
 * @author sundongdong
 * @date 2016-07-09
 */
class Base_UpshelfController extends Controller_NeedLogin {
	/**
	 * 初始化
	 */
	public function init() {
		parent::init();
		$this->model = new Base_Model_Upshelf();
	}
	/**
	 * 列表页
	 */
	public function indexAction() {
		$getData = $this->getRequest()->getParams();
		$params = array();
		
		$params['page'] = !empty($getData['page']) ? $getData['page'] : 1;
		$params['perPage'] = !empty($getData['page_size']) ? $getData['page_size'] : $this->page_size;
		$params['goods_sns'] = !empty($getData['goods_sns']) ? $getData['goods_sns']:'';
		$params['website'] = !empty($getData['website']) ? $getData['website']:'';
		$params['type'] = isset($getData['type']) ? $getData['type'] : '';
		$params['add_user'] = !empty($getData['add_user']) ? $getData['add_user']:'';
		$params['start'] = !empty($getData['start']) ? $getData['start']:'';
		$params['end'] = !empty($getData['end']) ? $getData['end']:'';
		
		$data = $this->model->getUpshelfList($params);
		$page_link = $this->page($data['count'], $this->page_size);

		$this->smarty->assign('params', $params);
		$this->smarty->assign('lists', $data['list']);
		$this->smarty->assign('page_link', $page_link);
		
		$this->smarty->display('upshelf.tpl');
	}
}